<div id="wrap_search_feature" class="activity_wrap">
	<div class="col-left">
		<?php if(!empty($activities)){ ?>
		
		<?php foreach($activities as $key=>$val): ?>
		<div class="activity_block_search">
			<div class="activity_mid_thumbnail">
				<?php 
					$val['upload_image'] = json_decode($val['upload_image']);
					echo isset($val['upload_image'][0])?'<img width="180" height="180" src="'.$this->config->item('image_uploader_original', 'layout').$val['user_id'].'/'.$val['upload_image'][0].'">':'<img src="'.$this->config->item('image_public', 'layout').'empty-image.png" width="180" height="180" />';
				?>
			</div>
			<div class="activity_info">
				<div class="info_head">
					<div class="user_image"><img src="<?php echo $this->config->item('image_public', 'layout'); ?>noavatar.gif" width="80" height="80" /></div>
					<div class="activity_short_desc">
						<p class="title"><span class="draft_title"><?php echo (($val['status']==0)?$this->lang->line('draft'):''); ?></span><a href="/activity/index/<?php echo $val['activity_id']?>"><?php echo $val['activity_title']?></a></p>
						<p><?php echo $val['activity_location']?>/<?php echo $val['activity_category']?></p>
						<p>5分</p>
					</div>
					<div class="activity_action">
						<p><?php echo $val['activity_price']?>元</p>
					</div>
				</div>
				<div class="info_body">
					<p><?php
					echo mb_substr(strip_tags($val['desc']), 0, 100, "UTF-8").'......<a href="/activity/index/'.$val['activity_id'].'">繼續閱讀</a>'; 
					?></p>
				</div>
			</div>
		</div>
		<?php endforeach; ?>
		
		<?php }else{ ?>
			無符合之結果，請重新搜尋
		<?php } ?>
	</div>
	
	<div class="sidebar">
		<div id="activities_new">
			<div id="activities_new_title"><?php echo $this->lang->line('activities_new_title')?></div>
			<div id="activities_new_show">
				<?php
				foreach($activities_new as $act){
					if($act['status'] == '1'){ //published activity
						echo '<div class="activities_new_block">';
						if(isset($act['upload_image']) && !empty($act['upload_image'])){
							$temp_upload_image = json_decode($act['upload_image']);
							$show_thumb = 	$temp_upload_image[0];
							echo '<div class="activities_new_thumb"><img width="117" height="80" src = "'.$this->config->item('image_uploader_thumbs','layout').$act['user_id'].'/'.$show_thumb.'"/></div>';
						}
						else{
							//empty_thumb_url
							echo '<div class="activities_new_thumb"><img width="117" height="80" src = "'.$this->config->item('empty_thumb_url','layout').'"/></div>';
						}
						echo '<div class="activities_title"><a href="'.$this->config->item('activity_url','layout').$act['activity_id'].'">'.$act['activity_title'].'</div>';	
						echo '</div>';
						
					}
				}
				?>
			</div>
		</div>
		<!--
		<div id="activity_action">
			<p class="left_count"><?php echo $this->lang->line('left').' <span>'.($activity_max_p-$join_count).'</span> '.$this->lang->line('quota_of_people'); ?></p>
			<input type="button" value="參加"/>
			<input type="button" value="收藏"/>
		</div>
		<div id="activity_comment">
			<div id="activity_comment_title">活動與描述相符</div>
			<div id="activity_comment_desc">
				<p id="score"><span>4.8</span>分</p>
				<p id="score_count">共902次評分</p>
			</div>
		</div>
		<div id="organizer_profile">
			<div id="organizer_profile_desc">
				<p id="organizer_avatar"><img width="220" height="220" src="/images/public/noavatar.gif"></p>
				<p id="organizer_name"><?php echo $username; ?></p>
				<p id="send_msg_to_organizer"><input type="button" value="傳訊息" onclick="sendMessageForm('<?php echo $email?>');" /></p>
			</div>
		</div>
		<?php if(count($activities['organizer']) > 1){
			?>
		<div id="activities_by_organizer">
			<div id="activities_by_organizer_title"><?php echo $this->lang->line('activities_by_organizer_title')?></div>
			<div id="activities_by_organizer_show">
				<?php
				foreach($activities['organizer'] as $act){
					if($act['status'] == '1' && $act['activity_id'] != $activity_id){ //published activity
						echo '<div class="activities_by_organizer_block">';
						if(isset($act['upload_image']) && !empty($act['upload_image'])){
							$temp_upload_image = json_decode($act['upload_image']);
							$show_thumb = 	$temp_upload_image[0];
							echo '<div class="activities_by_organizer_thumb"><img width="117" height="80" src = "'.$this->config->item('image_uploader_thumbs','layout').$id.'/'.$show_thumb.'"/></div>';
						}
						else{
							//empty_thumb_url
							echo '<div class="activities_by_organizer_thumb"><img width="117" height="80" src = "'.$this->config->item('empty_thumb_url','layout').'"/></div>';
						}
						echo '<div class="activities_title"><a href="'.$this->config->item('activity_url','layout').$act['activity_id'].'">'.$act['activity_title'].'</div>';	
						echo '</div>';
						
					}
				}
				?>
			</div>
		</div>
		<?php } ?>
		-->
	</div>
</div>